﻿@model PagedList.IPagedList<Domain.BLL.ProductBLL>
@{
    ViewBag.Title = "Products by Category";
    Layout = "~/Views/Shared/_MasterPage.cshtml";
    var imagefolder = "../../Images/ProductImages/";
    //var catid = "";
    //var CatId = Request.QueryString["CatId"];
    string[] Images; 
}


            <h4 class="headingBase headingXL saHeadingXL"> Go further. Do more. </h4>
            <p class="para">Our recommended Ultrabooks are all thin and light with HD touchscreens and batteries that go and go.</p>


@foreach (var item in Model) {
               
    Images = item.ImageName.Split(';'); 
                <div class="prodPane">
                    <div class="prodPaneImage">
                        <a href="/Products/Details/@item.ProductID"><img class="blkImg" src="@imagefolder@Images[0]" alt="Hình SP" /></a>
            
                    </div>
                    <div class="prodPaneHeading">
                    <h2 class="headingBase headingS">@Html.DisplayFor(modelItem => item.ProductName)</h2>
                    </div>
                    <div class="prodPaneDesc">
                    <div class="wolTextDesc">@Html.DisplayFor(modelItem => item.Description)</div>
                    <div class="wolTextDesc">@Html.DisplayFor(modelItem => item.CategoryID)</div>
                    </div>
                    <ul class="iListInnerList">
                    <li>
                        <p class="para">@Html.ActionLink("Chi Tiết", "Details/", new {CatId = item.CategoryID, id = item.ProductID })</p>
                    </li>
                    </ul>
                </div>
    
}



<div>
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount
     
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "Index", new { page = 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink("< Prev", "Index", new { page = Model.PageNumber - 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev
    }
     
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Next >", "Index", new { page = Model.PageNumber + 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "Index", new { page = Model.PageCount, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:Next >
        @Html.Raw(" ")
        @:>>
    }
</div>